import axios from '@/utils/axios';

// 获取供应商列表
export const shopList = (params) => {
    return axios({
        url: '/shop/list',
        method: 'get',
        params
    })
};

// 获取店铺详情
export const getShopDetail = (id) => {
    return axios({
        url: `/shop/detail/${id}`,
        method: 'get'
    })
};

// 创建店铺
export const createShop = (data) => {
    return axios({
        url: '/shop/add',
        method: 'post',
        data
    })
};

// 更新店铺信息
export const updateShop = ( data) => {
    return axios({
        url: '/shop/update',
        method: 'post',
        data
    })
};

// 删除店铺
export const deleteShop = (id) => {
    return axios({
        url: `/shop/delete/${id}`,
        method: 'delete'
    })
};

// 获取所有药店
export const getAllShop = () => {
    return axios({
        url: '/shop/all',
        method: 'get'
    })
};

// 通过店铺申请
export const doPassShop = (params) =>{
    return axios({
        url: 'shop/pass/'+params,
        method:'get'
    })
}

export const doRefuseShop = (params) =>{
    return axios({
        url: 'shop/refuse/'+params,
        method:'get'
    })
}